
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_application_1/login.dart';

class HomePage0 extends StatefulWidget {
  const HomePage0({super.key});

  @override
  State<HomePage0> createState() => _HomePage0State();
}

class _HomePage0State extends State<HomePage0> {
  @override
  Widget build(BuildContext context) {
    return  Expanded(child:ListView(children: [
    Container(
      padding: const EdgeInsets.only(top: 60, left: 28, right: 28),
      width: 360,
      height: 380,
      decoration: const BoxDecoration(
        image: DecorationImage(image:  AssetImage('images/home_bg_1.png'), 
        fit: BoxFit.contain,)),
      child: Column(children: [
        Align(
          alignment: Alignment.topRight,
          child: Container(
            height: 30, 
            padding: const EdgeInsets.all(8), 
            margin: const EdgeInsets.only(right: 16),
            decoration: BoxDecoration(color: const Color(0xFFFFFF).withAlpha(30), borderRadius: const BorderRadius.all(Radius.circular(15))), 
        child: const Text('Periode pinjaman91-180 hari!', style: TextStyle(fontSize: 12, color: Color(0xFFAEFFDB)),),
        ),),
        const SizedBox(height: 16),
        const Text('Rp5000,000', style: TextStyle(fontSize: 34, fontWeight: FontWeight.bold, color: Colors.white),),
        const SizedBox(height: 10),
        const Text('Jumlah pinjaman sampai dengan', style: TextStyle(fontSize: 14, fontWeight: FontWeight.normal, color: Colors.white),),
        const SizedBox(height: 24,),
        Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(width: 28, height: 1, color: const Color(0xFF84EDBF)),  
            const SizedBox(width: 16),
            const Text('keunggulan kami', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Color(0xFF84EDBF)),),
            const SizedBox(width: 16), 
           Container(width: 28, height: 1, color: const Color(0xFF84EDBF)),
        ],),
        const SizedBox(height: 16),
        iconsView,
        const SizedBox(height: 20),
        ElevatedButton(
          onPressed: (){
            // Navigator.push(context, MaterialPageRoute(builder: (context) =>  const LoginPage()));
            Navigator.of(context).push(MaterialPageRoute(fullscreenDialog: true,builder: (context)=> LoginPage()));
          }, 
          child: Container(padding: const EdgeInsets.only(left: 32, right: 32), child: const Text('Ajukan sekarang', style: TextStyle(color: Color(0xFF009E6D), fontWeight: FontWeight.bold, fontSize: 16)
        ),))
      ],),
      ),
    const SizedBox(height: 20),   
    Container(
      padding: const EdgeInsets.only(top: 18, left: 38),
      // width: 360,
      height: 77,
      decoration: const BoxDecoration(
        // color: Colors.red,
        image: DecorationImage(image:  AssetImage('images/home_banner.png'), 
        fit: BoxFit.contain,)),
      child: const Column(children: [
        Align(alignment: Alignment.topLeft, child: Text('Semakin banyak Anda meminjam, \nsemakin lama Anda meminjam', style: TextStyle(color: Color(0xFF1A7E69), fontSize: 12, fontWeight: FontWeight.w600),),)
      ],),
    )
    ],));

  }


  Widget iconsView = const Row(
    mainAxisAlignment: MainAxisAlignment.spaceAround,
    children: [
      Column(children: [
        Image(image: AssetImage('images/home_icon_0.png'), width: 40, height: 40,),
        Text('isi sederhana', style: TextStyle(color: Color(0xFF71DDAE), fontSize: 12, fontWeight: FontWeight.w500),)
      ]),
      Column(children: [
        Image(image: AssetImage('images/home_icon_1.png'), width: 40, height: 40,),
        Text('Pencairan cepat', style: TextStyle(color: Color(0xFF71DDAE), fontSize: 12, fontWeight: FontWeight.w500),)
      ]),
      Column(children: [
        Image(image: AssetImage('images/home_icon_2.png'), width: 40, height: 40,),
        Text('Keamanan data', style: TextStyle(color: Color(0xFF71DDAE), fontSize: 12, fontWeight: FontWeight.w500),)
      ]),
    ],
  );
}